home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / ole2book.zip / BASICS.ZIP / INC / IPOLY6.H < prev    next >
C/C++ Source or Header  |  1993-04-15  |  4KB  |  142 lines

  1. /*
  2.  * IPOLY6.H
  3.  * Chapter 6 Polyline Object
  4.  *
  5.  * Definition of an IPolyline interface for a Polyline object used
  6.  * in the Schmoo implementation.  This interface is custom and is
  7.  * only supported from DLL-based objects.
  8.  *
  9.  * Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  10.  *
  11.  * Kraig Brockschmidt, Software Design Engineer
  12.  * Microsoft Systems Developer Relations
  13.  *
  14.  * Internet  :  kraigb@microsoft.com
  15.  * Compuserve:  >INTERNET:kraigb@microsoft.com
  16.  */
  17.  
  18.  
  19. #ifndef _IPOLY6_H_
  20. #define _IPOLY6_H_
  21.  
  22.  
  23. //Versioning.
  24. #define VERSIONMAJOR                2
  25. #define VERSIONMINOR                0
  26. #define VERSIONCURRENT              0x00020000
  27.  
  28. #define CPOLYLINEPOINTS             20
  29.  
  30. //Version 2.0 Polyline Structure
  31. typedef struct __far tagPOLYLINEDATA
  32.     {
  33.     WORD        wVerMaj;                //Major version number.
  34.     WORD        wVerMin;                //Minor version number.
  35.     WORD        cPoints;                //Number of points.
  36.     BOOL        fReserved;              //Previously fDrawEntire, obsoleted
  37.     RECT        rc;                     //Rectangle of this figure (client)
  38.     POINT       rgpt[CPOLYLINEPOINTS];  //Array of points on 0-32767 grid.
  39.  
  40.     //Version 2.0 additions
  41.     COLORREF    rgbBackground;          //Background color
  42.     COLORREF    rgbLine;                //Line color
  43.     int         iLineStyle;             //Line style
  44.     } POLYLINEDATA, *PPOLYLINEDATA, FAR *LPPOLYLINEDATA;
  45.  
  46. #define CBPOLYLINEDATA   sizeof(POLYLINEDATA)
  47.  
  48.  
  49. /*
  50.  * !!Addition:  Clipboard format shared with using applications
  51.  * This name matches those in the stringtable of all Schmoo and CoSchmoo
  52.  * versions.  All data is interchangable.
  53.  */
  54. #define SZPOLYLINECLIPFORMAT        "Polyline Figure"
  55.  
  56.  
  57.  
  58. //We use the OLE 2.0 macro to define a new interface
  59. #undef  INTERFACE
  60. #define INTERFACE IPolylineAdviseSink6
  61.  
  62.  
  63. /*
  64.  * When someone initializes a polyline and is interested in receiving
  65.  * notifications on events, then they provide one of these objects.
  66.  */
  67.  
  68. DECLARE_INTERFACE_(IPolylineAdviseSink6, IUnknown)
  69.     {
  70.     //IUnknown members
  71.     STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  72.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  73.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  74.  
  75.     //Advise members.
  76.     STDMETHOD_(void,OnPointChange)     (THIS) PURE;
  77.     STDMETHOD_(void,OnSizeChange)      (THIS) PURE;
  78.     STDMETHOD_(void,OnColorChange)     (THIS) PURE;
  79.     STDMETHOD_(void,OnLineStyleChange) (THIS) PURE;
  80.  
  81.     //OnDataChange replaced with IAdviseSink
  82.     };
  83.  
  84. typedef IPolylineAdviseSink6 FAR * LPPOLYLINEADVISESINK;
  85.  
  86.  
  87.  
  88.  
  89. //We use the OLE 2.0 macro to define a new interface
  90. #undef  INTERFACE
  91. #define INTERFACE IPolyline6
  92.  
  93.  
  94. DECLARE_INTERFACE_(IPolyline6, IUnknown)
  95.     {
  96.     //IUnknown members
  97.     STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
  98.     STDMETHOD_(ULONG,AddRef)  (THIS) PURE;
  99.     STDMETHOD_(ULONG,Release) (THIS) PURE;
  100.  
  101.     //IPolyline members
  102.  
  103.     //File-related members use IPersistStorage
  104.     //Data transfer members use IDataObject
  105.  
  106.     //Manipulation members:
  107.     STDMETHOD(Init)   (THIS_ HWND, LPRECT, DWORD, UINT) PURE;
  108.     STDMETHOD(New)    (THIS) PURE;
  109.     STDMETHOD(Undo)   (THIS) PURE;
  110.     STDMETHOD(Window) (THIS_ HWND FAR *) PURE;
  111.  
  112.     STDMETHOD(SetAdvise) (THIS_ LPPOLYLINEADVISESINK) PURE;
  113.     STDMETHOD(GetAdvise) (THIS_ LPPOLYLINEADVISESINK FAR *) PURE;
  114.  
  115.     STDMETHOD(RectGet) (THIS_ LPRECT) PURE;
  116.     STDMETHOD(SizeGet) (THIS_ LPRECT) PURE;
  117.     STDMETHOD(RectSet) (THIS_ LPRECT, BOOL) PURE;
  118.     STDMETHOD(SizeSet) (THIS_ LPRECT, BOOL) PURE;
  119.  
  120.     STDMETHOD(ColorSet) (THIS_ UINT, COLORREF, COLORREF FAR *) PURE;
  121.     STDMETHOD(ColorGet) (THIS_ UINT, COLORREF FAR *) PURE;
  122.  
  123.     STDMETHOD(LineStyleSet) (THIS_ UINT, UINT FAR *) PURE;
  124.     STDMETHOD(LineStyleGet) (THIS_ UINT FAR *) PURE;
  125.     };
  126.  
  127.  
  128. typedef IPolyline6 FAR * LPPOLYLINE;
  129.  
  130.  
  131.  
  132. //Error values for data transfer functions, in SCODEs instead of #defines
  133. #define POLYLINE_E_INVALIDPOINTER      MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 1)
  134.  
  135.  
  136. //Color indices for color member functions
  137. #define POLYLINECOLOR_BACKGROUND    0
  138. #define POLYLINECOLOR_LINE          1
  139.  
  140.  
  141. #endif //_IPOLY6_H_
  142.